package com.hzqy.service.epg;

import com.hzqy.persistence.dao.epg.AcLotteryDao;
import com.hzqy.persistence.dao.epg.AcSignDao;
import com.hzqy.web.vo.AcWinningVo;
import com.hzqy.web.vo.epg.AcSignVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AcSignService {
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	@Resource
	private AcSignDao acDao;
	public  Map<String,Object> selectAc(AcSignVo asv, int page, int rows){
        Map<String,Object> map=new HashMap<String, Object>();
        map.put("f_asu_serverid", asv.getF_asu_serverid());
        map.put("f_asu_activityid", asv.getF_asu_activityid());
        map.put("beginDate", asv.getBeginDate());
        map.put("endDate", asv.getEndDate());
        Integer rowCount = acDao.selectAcCount(map);
        map.put("total", rowCount);
        if(rowCount>0 && page>0 && rows>0){
            map.put("firstResult", (page-1)*rows);
            map.put("maxResults", rows);
            List<AcSignVo> list=acDao.selectAcByRequest(map);
            map.put("rows", list);
        }else{
            map.put("rows", new ArrayList<AcSignVo>());
        }
        return map;
	}


}
